﻿@model LTSMZ.life.Model.Stock

@{
    ViewBag.Title = "Get_Stock";
    Layout = "~/Views/Shared/_Layout.cshtml";
}
<script src="~/Scripts/jquery-1.8.2.min.js"></script>
<script>
    function Jin(){
        var num = $("#text1").val();
        var id=@ViewBag.id;
        $.ajax({
            url:"/Home/Jin_Stock",
            type:"post",
            data:{
                Jin:num,
                id:id
            },
            success:function(data){
                if(data==1)
                {
                    alert("进货成功");
                    location.href="/Home/KucunShow";
                }
                else
                {
                    alert("系统繁忙！请稍后重试")
                }
            }
        })
    }
</script>
<h2>Get_Stock</h2>
<table>
    <tr>
        <td>产品名称: @Html.TextBox("Pname", Model.Pname, new { @readonly = "readonly" })</td>
    </tr>
    <tr>
        <td>进货数量: <input type="text" id="text1" /></td>
    </tr>
    <tr>
        <td><input id="Button1" type="button" value="进货" onclick="Jin()" /></td>
    </tr>
</table>